Can I Use JavaScript's Sort() Function Without Exceeding O(n) Complexity